Goto

Collaborating Authors

 implementing logistic regression


Implementing Logistic Regression from Scratch using Python

#artificialintelligence

This article was published as a part of the Data Science Blogathon. For this article, we will be using sklearn's make_classification dataset with four features This is the vectorised form of the gradient descent expression, which we will be using in our code. Now that we are done with every part, we will put everything together in a single class. You can fiddle around with hyper-parameters and see the behaviour of cost function. Now, let's see how our logistic regression fares in comparison to sklearn's logistic regression.


Implementing Logistic Regression for Stock Trading

#artificialintelligence

Most stock trading algorithms that incorporate machine learning are based upon some form of linear regression. There are benefits and drawbacks to this method. The benefit of this is that the predicted prices of linear regression can be integrated into more complex values, that need the actual price values to function. The drawback is that for the basic "buy low, sell high" strategy, it is not directly related to predicting the direction of the price. What would happen if we used logistic regression, or more specifically binary classification, to predict if the price will increase or decrease? Theoretically, it would hone in on direction itself, and become more accurate than the signals generated by linear regression.